package twentytwenty;

import java.util.Arrays;

/**
 * @Author: Zahi
 * @Description:
 * @Date Created in 2020-12-11 12:32
 * @Modified By:
 */
public class IsAnagram_242 {
    public static void main(String[] args) {

    }

    public static boolean isAnagram(String s, String t) {
        int sLength = s.length();
        int tLength = t.length();
        if (sLength != tLength){
            return false;
        }
        char[] str1 = s.toCharArray();
        char[] str2 = t.toCharArray();
        Arrays.sort(str1);
        Arrays.sort(str2);
        return Arrays.equals(str1, str2);
    }
}
